package com.job.yangshida.homework0709.lizi;

/**
 * @author 杨士达
 * @version 1.0
 * @since 2022-07-10 17:27:17
 */
public class Helper {


        //z展示一下功能 入参父类类型接受不同的子类
        public void show (Cellphone cellphone){
            System.out.println("k开始展示");
            cellphone.chat();
            System.out.println("完成展示");
        }
        //duo多态 返回值
        public Cellphone sell (int need){
            if (need == 1) {
                return new Cellphone();
            } else if (need == 2) {
                return new GamePhone();
            } else {
                return new PhotoPhone();
            }
        }
    }
